DO NOT MERGE: proper implementation of "askfirst" shell

Now it matches full implementation submitted upstream:
http://patchwork.ozlabs.org/patch/420980/

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>