jarlath @ Ubuntuforums has created a nice Dropbox script which closes Dropbox after the synchronization finishes.