PostgreSQL Drop Database With Connected Users
Once you've set datallowconn = 'false', it does exactly what it says on the tin, and doesn't allow connections to that database. 

Connecting as the postgres user to the template1 database should allow you to drop that database.

For more information check the documentation on template databases. They're quite useful. =)