Lengths of monotone subsequences in a Mallows permutation