I'm sure Singapore Airlines did this sort of thing years ago on their 777 fleet. There was a crew bunk behind the flight deck on the left of the corridor. When the door was opened it latched against the opposite wall forming a secure area between galley and flight deck.