Don't popup context menu with no items, fixes #2032.

On OS X popuping an empty context menu would have no effect but on Linux
an empty menu container would still be showed.