Fix Imap.php: Delete-Flag work's, but can't remove mail from server/mailbox

You need to send "CLOSE" before "LOGOUT" to remove delete-flagged messages from active message box - or: provide (at least) a function to do so manually

Fix (partly) issue #1