Fix DB logging for non-SELECT queries

They are not executed immediately so getting their source line is
impossible. Let's not fail in that case!
Fix reservation history usage

We store usernames, not avatar ids
Fix bug from earlier commit
Hide the prebook if user cannot even prebook
Use NonBookableDate.overlaps
Fix API error caused by earlier commit

getMethodName is called before getParams now
Check blockings when booking a room