correct handling for incomplete hash/array parameters

Two problems:
1. incompete parameters with single bracket caused an exception "Expected Hash, ...", while it is pretty much valid parameter name
2. rack.request.query_hash should be only set after query is parsed. Otherwise, in case of thrown exception, client will get exception only first time, next time execution goes inside first if block and nil is being returned. This leads to absolutely weird and non-descriptive exception in params method (No method merge for Nil)