The US State Department says it has closed its embassy to the public in Yemen due to recent attacks against Western interests.