This is not a (new) answer to the original question, but I don't have enough reputation to comment. I tried to address the call for generalization using a similar technique as Jaap. Below the results for the board sizes that fit in my main memory. Unfortunately, 6 x 6 does not fit.
size # configs w b=========================3 x 2 180 12 133 x 3 3360 16 173 x 4 69300 20 193 x 5 1513512 24 233 x 6 34306272 26 273 x 7 798145920 30 314 x 2 840 10 114 x 3 36960 14 154 x 4 1801800 18 194 x 5 93117024 22 234 x 6 4997280288 26 275 x 2 2520 10 115 x 3 200200 14 135 x 4 17635800 18 175 x 5 1647455040 22 216 x 2 5940 10 116 x 3 742560 14 136 x 4 102965940 18 177 x 2 12012 10 117 x 3 2170560 14 137 x 4 435134700 18 178 x 2 21840 10 118 x 3 5383840 14 138 x 4 1472562000 18 17
The last two columns give the minimal number of steps (ply) to the final position with either white (w) or black (b) to play.
The number of configurations is given by: $2 \cdot {n \cdot m \choose m} \cdot {n \cdot m - m \choose m}$, with $n$ the number of rows and $m$ the number of columns.