Fix dirname invocation so it works on 12.04.

Signed-off-by: Rex Tsai (蔡志展) <rex.tsai@canonical.com>
checked the patch folder is exist.

Signed-off-by: Rex Tsai (蔡志展) <rex.tsai@canonical.com>