Bug fixes: #982172, #980841

Bug 982172 - Do not try to unreserve_uid if we don't get valid container for the gear.
Bug 980841 - Need to pass 'container' instead of 'uuid' for ApplicationState constructor