Average Linear Time and Compressed Space Construction of the Burrows-Wheeler Transform