The code in masquerade_user_logout($account) contains
if (!empty($account->masquerading))
The users could not logout back to their original user. I changed the code to the following and users could logout without problems using the standard Drupal logout menu entry.
if (!empty($_SESSION['masquerading']))

An alternative might be to load $account->masquerading in hook_user_load.