AP_Menu: dynamically allocate the menu buffers

this saves memory when the menus are not used, and allows for the
commandline and argument limits to be changed
AP_Menu: zero buffer contents on allocation
AP_Menu: added check_for_input() API

this allows for async use of the menus, so that a main loop can run
while allowing the user to enter menu commands
AP_Menu: fixed double display of prompt